package com.zhuchaooasystem.adapter.holder;

import android.view.ViewGroup;
import android.widget.TextView;

import com.jude.easyrecyclerview.adapter.BaseViewHolder;
import com.zhuchaooasystem.R;
import com.zhuchaooasystem.entity.InformMessageEntity;

/**
 * @author yinsi
 */
public class InformMessageReadHolder extends BaseViewHolder<InformMessageEntity.ResultBean.SuccessfulBean.ReadMsgBean> {
    //----
    private TextView tv_state;
    private TextView tv_detail;

    public InformMessageReadHolder(ViewGroup parent) {
        super(parent, R.layout.item_recycleview_inform_message_read);
        //----
        tv_state = $(R.id.item_recyclecview_inform_message_state);
        tv_detail = $(R.id.item_recyclecview_inform_message_detail);
    }

    @Override
    public void setData(final InformMessageEntity.ResultBean.SuccessfulBean.ReadMsgBean message) {
        tv_state.setText(message.getType());
        //----
//        String content = message.getTitle()+ message.getBody();
//        if (content.contains("\r")) {
//            content = content.replace("\r", "\n");
//        }
//        tv_detail.setText(content, new SparseBooleanArray(), getDataPosition());
        tv_detail.setText(message.getTitle() + message.getBody());
    }

}
